﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace StarControl.Animations
{
    public class AnimationCollection
    {

        public Dictionary<string, Animation> Animations = new Dictionary<string, Animation>();

        public string currentAnimation;

        public Vector2 Position = Vector2.Zero;

        public AnimationCollection()
        {

        }

        public void AddAnimation(Animation animation, string AnimationName)
        {
            Animations.Add(AnimationName, animation);
        }

        public void changeAnimation(string AnimationName)
        {
            currentAnimation = AnimationName;
        }

        public void Update(GameTime gameTime)
        {
            Animations[currentAnimation].Update(gameTime);
        }

        public void Draw(ref SpriteBatch spriteBatch)
        {
            Animations[currentAnimation].Draw(ref spriteBatch, Position);
        }

    }
}
